package demo25;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sr=new Scanner(System.in);
        int x1,y1;
        x1=sr.nextInt();
        y1=sr.nextInt();
        int[][] a=new int[x1][y1];
        for (int i = 0; i < x1; i++) {
            for (int j = 0; j < y1; j++) {
                a[i][j]=sr.nextInt();
            }
        }
        int x2,y2;
        x2=sr.nextInt();
        y2=sr.nextInt();
        int[][] b=new int[x2][y2];
        for (int i = 0; i < x2; i++) {
            for (int j = 0; j < y2; j++) {
                b[i][j]=sr.nextInt();
            }
        }
        for (int i = 0; i < x1; i++) {
            for (int j = 0; j < y2; j++) {
                int sum=0;
                for (int k = 0; k < y1; k++) {
                    sum+=a[i][k]*b[k][j];
                }
                System.out.print(sum+" ");
            }
            System.out.println();
        }
    }
}
